package algutil.bean;

import java.sql.ResultSet;
import java.sql.SQLException;

/**@deprecated*/
public class TrackBean {

	private int id;

	private String nom;

	private int idAlbum;

	private int numero;

	private String parole = null;

	private String commentaire = null;

	public TrackBean() {
	}

	public TrackBean(ResultSet rs) throws SQLException {
		setTrack(rs);
	}

	public int getId() {
		return id;
	}

	public void setId(int i) {
		id = i;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String n) {
		nom = n;
	}

	public int getIdAlbum() {
		return idAlbum;
	}

	public void setIdAlbum(int a) {
		idAlbum = a;
	}

	public int getNumero() {
		return numero;
	}

	public String getNumeroString() {

		if (numero > 9)
			return "" + numero;
		else
			return "0" + numero;
	}

	public void setNumero(int n) {
		numero = n;
	}

	public String getParole() {
		return parole;
	}

	public void setParole(String p) {
		parole = p;
	}

	public String getCommentaire() {
		return commentaire;
	}

	public void setCommentaire(String c) {
		commentaire = c;
	}

	public void setTrack(ResultSet rs) throws SQLException {
		setId(rs.getInt("ch_id"));
		setNom(rs.getString("ch_nom"));
		setIdAlbum(rs.getInt("ch_al_id"));
		setNumero(rs.getInt("ch_numero"));
		setParole(rs.getString("ch_parole"));
	}

	public String toString() {
		return "[" + id + "] " + getNumeroString() + " " + nom;
	}
}